using Bean.Entity;
using Bean.Entity.Enum;
using Bean.Infrastructure;
using Bean.Repository;
using Bean.Service.IService;
using Microsoft.Extensions.Logging;

namespace Bean.Service.Service;

/// <summary>
/// 
/// </summary>
public class OTAFieldService:IOTAFieldService,ITransientService
{
    public readonly ILogger<OTAFieldService> _Logger;

    private readonly IRepository<OTAField> _repository;

    public OTAFieldService(ILogger<OTAFieldService> logger,IRepository<OTAField> repository)
    {
        _Logger = logger;
        _repository = _repository;
    }
    /// <summary>
    /// 通过ota平台和政策类型获取对应平台的有效的未删除的字段
    /// </summary>
    /// <returns></returns>
    /// <exception cref="NotImplementedException"></exception>
    public async Task<List<OTAFieldDto>> GetListAsync(CIDEnum otaType,PolicyTypeEnum policyType)
    {
      var response= await  _repository.AsQueryable().Where(w =>
            w.IsActive == true && w.IsDeleted == true && w.OtaType == otaType &&
            w.PolicyType == policyType).Select(s=> new OTAFieldDto
      {
           
      }).ToListAsync();

      return response;
    }
    
    
}